/*
 * @Author: chenyn 1826650603@qq.com
 * @Date: 2024-01-05 10:09:58
 * @LastEditors: chenyn 1826650603@qq.com
 * @LastEditTime: 2024-01-25 18:38:38
 * @FilePath: \smart-campus-platform-manage-vue\config\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.

const path = require('path')

module.exports = {
  dev: {
    env: require('./dev.env'),
    port: 8082,
    autoOpenBrowser: true,
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    proxyTable: {
      '/api': {
        // target: 'http://172.16.9.20:2222',
        target: 'http://172.16.14.141',
        // target: 'http://112.94.21.40:8808',
        // target : 'http://172.16.110.188:80',/*杨*/
        changeOrigin: true,
        pathRewrite: {
          '^/api': ''
        }
      },
    },
    cssSourceMap: false
  },

  build: {
    env: require('./prod.env'),
    index: path.resolve(__dirname, '../dist/index.html'),
    assetsRoot: path.resolve(__dirname, '../dist'),
    // assetsSubDirectory: 'static',
    // assetsPublicPath: '/',
    assetsSubDirectory: 'static', //除了 index.html 之外的静态资源要存放的路径，
    assetsPublicPath: '/', //代表打包后，index.html里面引用资源的的相对地址
    productionSourceMap: true,
    // Gzip off by default as many popular static hosts such as
    // Surge or Netlify already gzip all static assets for you.
    // Before setting to `true`, make sure to:
    // npm install --save-dev compression-webpack-plugin
    productionGzip: false,
    productionGzipExtensions: ['js', 'css'],
    // Run the build command with an extra argument to
    // View the bundle analyzer report after build finishes:
    // `npm run build --report`
    // Set to `true` or `false` to always turn it on or off
    bundleAnalyzerReport: process.env.npm_config_report
  }
}
